package com.zhg.hx.generator;

import java.util.Iterator;

/**
 * Created by zhenghegong on 2019/12/3.
 */
public abstract class Generable<E> implements Iterable<E> {
    //模版方法
    public abstract Generator<E> generator();

    //此方法不能被子类重写
    @Override
    final public Iterator<E> iterator() {
        return generator();
    }
}
